<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>makeLine :: Functions (k-Wave)</title>
	<link rel="stylesheet" href="kwavehelpstyle.css" type="text/css">
</head>

<body>
<div class="content">

<h1>makeLine</h1>
<p class="purpose">Create a binary map of a straight line within a 2D grid.</p>

<h2>Syntax</h2>

<pre class="codeinput">
line = makeLine(Nx, Ny, startpoint, endpoint)
line = makeLine(Nx, Ny, startpoint, angle, length)
</pre>

<h2>Description</h2>

<p><code>makeLine</code> creates a binary map of a line within a two-dimensional grid (the line is denoted by 1's in the matrix with 0's elsewhere). The line can be defined either by its endpoints or by a starting point, an angle (direction), and a length.

<h2>Inputs</h2>

<table class="body">
    <tr valign="top">
        <td width = "150"><code>Nx, Ny</code></td>
        <td>size of the 2D grid [grid points]</td>
    </tr>     
    
    <tr valign="top">
        <td width = "150"><code>startpoint</code></td>
        <td>two-element vector identifying the start point for the line [grid points]</td>
    </tr>    
    
    <tr valign="top">
        <td width = "150"><code>endpoint</code></td>
        <td>two-element vector identifying the end point for the line [grid points]</td>
    </tr>    

    <tr valign="top">
        <td width = "150"><code>angle</code></td>
        <td>the direction of the line [radians]</td>
    </tr>     
    
    <tr valign="top">
        <td width = "150"><code>length</code></td>
        <td>the length of the line [grid points]</td>
    </tr>     
</table>

<h2>Outputs</h2>

<table class="body">
    <tr valign="top">
        <td width = "150"><code>line</code></td>
        <td>2D binary map of a line</td>
    </tr>
</table>

<h2>See Also</h2>

<code><a href="makeArc.html">makeArc</a></code>, <code><a href="makeCircle.html">makeCircle</a></code>, <code><a href="makeDisc.html">makeDisc</a></code>

</div></body></html>